package com.多线程07.demo07;

public class MyThread extends Thread {

    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i=0;i<100;i++){
            System.out.println(getName()+":"+i);
        }
    }

    public static void main(String[] args) {

        MyThread t1 = new MyThread("女神");
        MyThread t2 = new MyThread("备胎");
        t1.setPriority(10);
        t2.setPriority(5);
        //当普通线程执行完毕，守护线程就没有执行下去的必要 了，也就会终止运行
        t2.setDaemon(true);

        t1.start();
        t2.start();


    }

}
